import React, { Component } from 'react';
import style from './list_main_list.module.css'
import { Link } from 'react-router-dom'
class list_main_List extends Component {
    render() {
        let shoplist = this.props.shoplist
        console.log(shoplist)
        let listmain = shoplist.length === 0 ? <div style={{textAlign:'center'}}>没有符合条件</div> : shoplist.length && shoplist.map(item => {
            return <Link key={item.id + 200} to={{ pathname:'/details',state:{id:item.id,name:'张三'} }}>
                <li  className={style.list_topic}>
                    <div className={style.list_left}>
                        <img src={item.imgs} />
                    </div>
                    <div className={style.list_right}>
                        <h4><span>{item.name}</span><span className={style.shoumai}>{item.saleType}</span></h4>
                        <p className={style.right_center}><span>普通住宅</span><span>沈阳市</span><span>|</span>
                            <span>{item.areaHigh}㎡-{item.areaLow}㎡</span></p>
                        <p className={style.right_price}><span>{item.priceLow}</span>元/㎡起</p>
                        <p className={style.right_fenlei}><span className={style.right_fenlei_anxin}>安心购</span><span>{item.specials}</span></p>
                    </div>
                </li></Link>
        })
        return (
            <div>
                <ul>
                    {listmain}
                </ul>
            </div>
        );
    }
}

export default list_main_List